from django.db import models
from django.utils.timezone import now


class Imgs(models.Model):
    title = models.CharField(max_length=50, default='默认标题', verbose_name="图片名称")
    img_title = models.CharField(max_length=50, verbose_name="图片名称")
    img_url = models.ImageField(verbose_name='图片路径', default='default.png', upload_to='images/')
    content = models.TextField(verbose_name='图片描述', default='添加描述')
    img_content = models.TextField(verbose_name='图片描述', default='添加描述')
    created_time = models.DateTimeField(verbose_name='创建时间', default=now)
    last_mod_time = models.DateTimeField(verbose_name='修改时间', default=now)

    class Meta:
        ordering = ['-created_time']